<template>
	<view>
		<back-fixed title="企业数据同步"></back-fixed>
		<view class="main">
			<view class="m-t-20">
				<view class="list" v-for="n,k in list" :key="n.name">
					<view class="list_box" :class="{'none_bot':k == 3}" @click="sync(n.id)">
						<view class="title">
							{{n.name}}
						</view>
						<view class="icons">
							同步
						</view>
					</view>
				</view>
			</view>
			<view class="sync">
				<view class="title">
					每5分钟自动同步
				</view>
				<view class="">
					<u-switch v-model="checked" active-color="#4DC0D9" inactive-color="#CCCCCC"></u-switch>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
						name: '同步团队成员列表',
						id: 1
					},
					{
						name: '同步患者列表',
						id: 2
					},
					{
						name: '同步患友群列表',
						id: 3
					},
					{
						name: '同步患者标签',
						id: 4
					}
				],
				checked: true,
			}
		},
		onLoad() {

		},
		methods: {
			sync(id) {
				if (id == '1') { //同步团队成员列表
					this.$u.toast('同步团队成员列表')
				}
				if (id == '2') { //同步患者列表
					this.$u.toast('同步患者列表')
				}
				if (id == '3') { //同步患友群列表
					this.$u.toast('同步患友群列表')
				}
				if (id == '4') { //同步患者标签
					this.$u.toast('同步患者标签')
				}
			}
		},
	}
</script>

<style lang="scss" scoped>
	.main {
		padding-top: 170rpx;
		background-color: #F8F8F8;
		position: absolute;
		height: 100vh;
		width: 100vw;

		.list {
			background-color: white;

			//margin-top: 20rpx;
			.list_box {
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 40rpx 24rpx;
				border-bottom: 1px solid #e8e8e8;

				.icons {
					font-family: PingFang SC, PingFang SC;
					font-weight: 500;
					font-size: 30rpx;
					color: #4DC0D9;
					line-height: 35rpx;
					background: #A6DFEC;
					border-radius: 12rpx;
					padding: 8rpx 30rpx;
				}
			}
		}
	}

	.sync {
		display: flex;
		background-color: white;
		justify-content: space-between;
		padding: 40rpx 24rpx;
		margin-top: 20rpx;
	}

	.none_bot {
		border-bottom: none !important;
	}

	.title {
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 32rpx;
		color: #212121;
		line-height: 38rpx;

	}
</style>